#include "draw.h"
GLvoid glPrint(GLuint base, const char *fmt, ...)                                       // Custom GL "Print" Routine
{
        char            text[256];                                                              // Holds Our String
        va_list         ap;                                                                             // Pointer To List Of Arguments

        if (fmt == NULL)                                                                        // If There's No Text
                return;                                                                                 // Do Nothing

        va_start(ap, fmt);                                                                      // Parses The String For Variables
            vsprintf_s(text, fmt, ap);                                          // And Converts Symbols To Actual Numbers
        va_end(ap);                                                                                     // Results Are Stored In Text

        glPushAttrib(GL_LIST_BIT);                                                      // Pushes The Display List Bits
        glListBase(base - 32);                                                          // Sets The Base Character to 32
        glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);      // Draws The Display List Text
        glPopAttrib();                                                                          // Pops The Display List Bits
}
int DrawString(std::string text, float posx, float posy, GLuint base)
{
        glLoadIdentity();                                                                       // Reset The Current Modelview Matrix
        glTranslatef(0.0f,0.0f,-1.0f);                                          // Move One Unit Into The Screen
        // Pulsing Colors Based On Text Position
        glColor3f(1.0f, 1.0f, 1.0f);
        // Position The Text On The Screen
        glRasterPos2f(posx, posy);
        glPrint(base, text.c_str());    // Print GL Text To The Screen
        return 0;
}